﻿package chapter_03_Homework;

import java.util.Arrays;

public class Work_PaiXu {
	public void sortNames(String[] names){
		Arrays.sort(names);
	}

	public static void main(String[] args) {
		Work_PaiXu px = new Work_PaiXu();
		String[] names = {"Tom","Jack","Merry","Smith","Sunny"};
		System.out.println("******排序前******");
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null)
				System.out.print(names[i]+"\t");
		}
		px.sortNames(names);
		System.out.print("\n******排序后******\n");
		for (int i = 0; i < names.length; i++) {
			System.out.print(names[i]+"\t");
		}
	}
}
